home *** CD-ROM | disk | FTP | other *** search
-
-
- tar(C) 06 January 1993 tar(C)
-
- _N_a_m_e
-
- tar - archive files
-
- _S_y_n_t_a_x
-
- ttaarr [ _kk_ee_yy ] [ _ff_ii_ll_ee_ss ]
-
- _D_e_s_c_r_i_p_t_i_o_n
-
- The ttaarr command saves and restores files to and from an archive medium,
- which is typically a floppy disk or tape, or a standard file. Its
- actions are controlled by the _kk_ee_yy argument. The _kk_ee_yy is a string of char-
- acters containing at most one function letter and possibly one or more
- function modifiers. Valid function letters are rr, xx, tt, uu, cc, and ee.
- Other arguments to the command are _ff_ii_ll_ee_ss (or directory names) specifying
- which files are to be backed up or restored. In all cases, a directory
- name refers to the files and (recursively) the subdirectories of that
- directory. The rr and uu options cannot be used with tape devices.
-
- The function portion of the key is specified by one of the following
- letters:
-
- rr The named _ff_ii_ll_ee_ss are written to the end of an existing archive.
-
- xx The named _ff_ii_ll_ee_ss are extracted from the archive. If a named
- file matches a directory whose contents had been written onto
- the archive, this directory is (recursively) extracted. The
- owner, modification time, and mode are restored (if possible).
- If no _ff_ii_ll_ee_ss argument is given, the entire contents of the
- archive are extracted. Note that if several files with the
- same name are on the archive, the last one overwrites all ear-
- lier ones.
-
- tt The names of the specified files are listed each time that they
- occur on the archive. If no _ff_ii_ll_ee_ss argument is given, all the
- names on the archive are listed.
-
- uu The named _ff_ii_ll_ee_ss are added to the archive if they are not
- already there, or if they have been modified since last written
- on that archive.
-
- cc Creates a new archive; writing begins at the beginning of the
- archive, instead of after the last file.
-
- The following characters may be used in addition to the letter that
- selects the desired function:
-
- 00,,......,,99999999
- This numeric key selects the device on which the archive is
- mounted. The available numeric keys are defined in the file
- /_e_t_c/_d_e_f_a_u_l_t/_t_a_r. A list of archive devices and their corre-
- sponding numeric keys can be displayed by entering ttaarr without
- any arguments. The ff option is used to specify an archive de-
- vice which is not in /_e_t_c/_d_e_f_a_u_l_t/_t_a_r.
-
- vv Normally, ttaarr does its work silently. The vv (verbose) option
- causes it to display the name of each file it treats, preceded
- by the function letter. With the tt function, vv gives more in-
- formation about the archive entries than just the name.
-
- ww Causes ttaarr to display the action to be taken, followed by the
- name of the file, and then wait for the user's confirmation.
- If a word beginning with ``y'' is given, the action is per-
- formed. Any other input means ``no''.
-
- ff Causes ttaarr to use the next argument as the name of the archive
- instead of the default device listed in /_e_t_c/_d_e_f_a_u_l_t/_t_a_r. If
- the name of the file is a dash (-), ttaarr writes to the standard
- output or reads from the standard input, whichever is appropri-
- ate. Thus, ttaarr can be used as the head or tail of a pipeline.
- ttaarr can also be used to move hierarchies with the command:
-
- ccdd ffrroommddiirr;; ttaarr ccff -- .. || ((ccdd ttooddiirr;; ttaarr xxff --))
-
- bb Causes ttaarr to use the next argument as the blocking factor for
- archive records. The default is 1, the maximum is 20. This
- option should only be used with raw magnetic tape archives (see
- ff above). The block size is determined automatically when
- reading tapes (key letters xx and tt).
-
- FF Causes ttaarr to use the next argument as the name of a file from
- which succeeding arguments are taken.
-
- ll Tells ttaarr to display an error message if it cannot resolve all
- of the links to the files being backed up. If ll is not speci-
- fied, no error messages are displayed.
-
- mm Tells ttaarr not to restore the modification times. The modifica-
- tion time of the file is the time of extraction.
-
- kk Causes ttaarr to use the next argument as the size of an archive
- volume in kilobytes (K). The minimum value allowed is 250.
- Very large files are split into ``extents'' across volumes.
- When restoring from a multi-volume archive, ttaarr only prompts
- for a new volume if a split file has been partially restored.
- To override the value of kk in the default file, specify kk as 0
- on the command line.
-
- ee Prevents files from being split across volumes (tapes or floppy
- disks). If there is not enough room on the present volume for
- a given file, ttaarr prompts for a new volume. This is only valid
- when the kk option is also specified on the command line.
-
- nn Indicates the archive device is not a magnetic tape. The kk
- option implies this. Listing and extracting the contents of an
- archive are faster because ttaarr can seek over files it wishes to
- skip. Sizes are printed in kilobytes instead of tape blocks.
-
- pp Indicates that files are extracted using their original permis-
- sions. It is possible that a non-super user may be unable to
- extract files because of the permissions associated with the
- files or directories being extracted.
-
- AA Suppresses absolute filenames. Any leading ``/'' characters are
- removed from filenames. During extraction arguments given
- should match the relative (rather than the absolute) pathnames.
- With the cc, rr, and uu options, the AA option can be used to inhi-
- bit putting leading slashes in the archive headers.
-
- qq During extraction causes ttaarr to exit immediately after each
- file on the command line has been extracted, rather than con-
- tinuing to look for additional files of the same name.
-
- LL Follow symbolic links. By default, symbolic links are not fol-
- lowed; when ttaarr encounters a symbolic link, it issues a warning
- message, skips over the link, and continues with the rest of
- the files.
-
- TT Truncates filenames of greater than 14 characters on extrac-
- tion. This is used for extracting files from EAFS-type file-
- systems that support long filenames (up to 255 characters long)
- to AFS-type filesystems that support maximum 14-character
- filenames.
-
- If no archive device is specified, either by using a numeric key or the ff
- option, ttaarr looks for a line in the file /_e_t_c/_d_e_f_a_u_l_t/_t_a_r beginning with
- the string aarrcchhiivvee==. Following this string are 4 fields, separated by
- spaces, which contain values for the device name, blocking factor, volume
- size, and device type. The blocking factor is the size in kilobytes of
- each block on the archive medium. The volume size entry should be modi-
- fied to reflect the size in kilobytes of the archive volume used. Note
- that a volume size of `0' indicates infinite volume length. The device
- type is set to yy for tape devices; otherwise, it is set to nn.
-
- For example, the following is the default device entry from
- /_e_t_c/_d_e_f_a_u_l_t/_t_a_r:
-
- archive=/dev/fd096ds15 10 1200 n
-
- This indicates that the default device is a floppy disk drive with a
- blocking factor of 10K and a volume size of 1.2 megabytes (1.2M). Any
- default value may be overridden using the bb and kk options.
-
- When a numeric key (#, in the range 0-9999) is specified, the corre-
- sponding device attributes are read from the line beginning with
- aarrcchhiivvee##== in the file /_e_t_c/_d_e_f_a_u_l_t/_t_a_r. The remainder of the line has the
- same format as for the default archive device.
-
- The default file /_e_t_c/_d_e_f_a_u_l_t/_t_a_r must exist if a device is not specified
- on the command line using the ff option.
-
- A critical consideration when creating a tar volume involves the use of
- absolute or relative pathnames. Consider the following ttaarr command exam-
- ples, as executed from the directory /_u/_t_a_r_g_e_t:
-
- ttaarr ccvv //uu//ttaarrggeett//aarrrrooww
- ttaarr ccvv aarrrrooww
-
- The first command creates a tar volume with the absolute pathname:
- /_u/_t_a_r_g_e_t/_a_r_r_o_w. The second yields a tar volume with a relative path-
- name: ./_a_r_r_o_w. (The ./ is implicit and shown here as an example; ./
- should not be specified when retrieving the file from the archive.) When
- restored, the first example results in the file _a_r_r_o_w being written to
- the directory /_u/_t_a_r_g_e_t (if it exists and you have write permission) no
- matter what your working directory. The second example simply writes the
- file _a_r_r_o_w to your present working directory.
-
- Absolute pathnames specify the location of a file in relation to the root
- directory (/); relative pathnames are relative to the current directory.
- This must be taken into account when making a tar tape or disk. Backup
- volumes use absolute pathnames so that they can be restored to the proper
- directory. Use relative pathnames when creating a tar volume where abso-
- lute pathnames are unnecessary.
-
- _E_x_a_m_p_l_e_s
-
- If the name of a floppy disk device is /_d_e_v/_f_d_1, then a tar format file
- can be created on this device by entering:
-
- aassssiiggnn //ddeevv//ffdd
- ttaarr ccvvffkk //ddeevv//ffdd11 336600 _ff_ii_ll_ee_ss
-
- where _ff_ii_ll_ee_ss are the names of files you want archived and 360 is the capa-
- city of the floppy disk in kilobytes. Note that arguments to key letters
- are given in the same order as the key letters themselves, thus the ffkk
- key letters have corresponding arguments /_d_e_v/_f_d_1 and 360. If you
- aassssiiggnn(C) the disk at the beginning, remember to ddeeaassssiiggnn it when you
- have finished.
-
- To display a listing of the archive, enter:
-
- ttaarr ttvvff //ddeevv//ffdd11
-
- At some later time you may want to extract the files from the archive
- floppy. You can do this by entering:
-
- ttaarr xxvvff //ddeevv//ffdd11
-
- The above command extracts all files from the archive, using the exact
- same pathnames as used when the archive was created. Because of this
- behavior, it is normally best to save archive files with relative path-
- names rather than absolute ones, since directory permissions may not let
- you read the files into the absolute directories specified. (See the AA
- flag under ``Options''.)
-
- In the above examples, the vv verbose option is used simply to confirm the
- reading or writing of archive files on the screen. Also, a normal file
- could be substituted for the floppy device /_d_e_v/_f_d_1 shown in the exam-
- ples.
-
- If the default device were to be used for the above examples, the corre-
- sponding ttaarr commands would be:
-
- ttaarr ccvvkk 336600 _ff_ii_ll_ee_ss
- ttaarr ttvv
- ttaarr xxvv
-
- The ttaarr commands for the device corresponding to 5 in the device table
- would be:
-
- ttaarr ccvv55kk 336600 _ff_ii_ll_ee_ss
- ttaarr ttvv55
- ttaarr xxvv55
-
- _F_i_l_e_s
-
- /_e_t_c/_d_e_f_a_u_l_t/_t_a_r
- Default devices, blocking and volume sizes, device type
- /_t_m_p/_t_a_r*
-
- _S_e_e _a_l_s_o
-
- aassssiiggnn(C) and ttaarr(F).
-
- _D_i_a_g_n_o_s_t_i_c_s
-
- Displays an error message about bad key characters and archive read/write
- errors.
-
- Displays an error message if not enough memory is available to hold the
- link tables.
-
- _N_o_t_e_s
-
- There is no way to ask for the _nnth occurrence of a file.
-
- ttaarr does not verify the selected media type.
-
- The uu option can be slow.
-
- The limit on pathname length is 100 characters.
-
- When archiving a directory that contains subdirectories, ttaarr will only
- access those subdirectories that are within 17 levels of nesting. Sub-
- directories at higher levels will be ignored after ttaarr displays an error
- message.
-
- When using ttaarr with a raw device, specify the block size with the bb
- option as a multiple of 512 bytes. For example, to use a 9K block size,
- enter:
-
- ttaarr ccvvffbb //ddeevv//rrffdd00 1188 _ff_ii_ll_ee
-
- Do not enter:
-
- ttaarr xxffFF -- --
-
- This would imply taking two things from the standard input at the same
- time.
-
- Use error-free floppy disks for best results with ttaarr.
-
-